load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbsource//xplat/folly:defs.bzl", "folly_xplat_library")
load("@fbsource//xplat/pfh/triage_InfrastructureSupermoduleOptou:DEFS.bzl", "triage_InfrastructureSupermoduleOptou")

oncall("fbcode_entropy_wardens_folly")

# xplat build rules

non_fbcode_target(
    _kind = folly_xplat_library,
    name = "test_util",
    srcs = [
        "TestUtil.cpp",
    ],
    fbandroid_deps = [
        "//xplat/third-party/linker_lib:atomic",
    ],
    feature = triage_InfrastructureSupermoduleOptou,
    raw_headers = [
        "TestUtil.h",
    ],
    deps = [
        "fbsource//xplat/folly/portability:fcntl",
        "//third-party/boost:boost",
        "//third-party/boost:boost_regex",
        "//third-party/glog:glog",
        "//xplat/folly:exception",
        "//xplat/folly:file",
        "//xplat/folly:file_util",
        "//xplat/folly:memory",
        "//xplat/folly:string",
        "//xplat/folly/ext:test_ext",
        "//xplat/folly/ext/buck2:test_ext",
    ],
    exported_deps = [
        "fbsource//xplat/folly/experimental/io:fs_util",
        "//xplat/folly:range",
        "//xplat/folly:scope_guard",
    ],
)

# fbcode build rules

fbcode_target(
    _kind = cpp_library,
    name = "test_util",
    srcs = ["TestUtil.cpp"],
    headers = ["TestUtil.h"],
    deps = [
        "//folly:exception",
        "//folly:file",
        "//folly:file_util",
        "//folly:memory",
        "//folly:string",
        "//folly/ext:test_ext",
        "//folly/ext/buck2:test_ext",
        "//folly/portability:fcntl",
    ],
    exported_deps = [
        "//folly:range",
        "//folly:scope_guard",
        "//folly/experimental/io:fs_util",
    ],
    external_deps = [
        "glog",
        ("boost", None, "boost_regex"),
    ],
)
